
		//pos_y -= keys[UP] * 4;
		//  pos_y += keys[DOWN] * 4;
		//if (pos_y >= ground_y) {
		//	pos_y = ground_y;
		//	vel_y = 0;
		//} else {
		//	vel_y -= 0.1;
		//}
		//if (keys[UP] && pos_y>=ground_y) {
		//	vel_y = 3;
		//}
		//  pos_x -= keys[LEFT] * 4;
		//  pos_x += keys[RIGHT] * 4;
		//  if (pos_x<0) pos_x = 0;
		//  if (pos_x>width-30) pos_x = width-30;
		//  pos_y -= vel_y * 4;

		//al_draw_filled_rectangle(pos_x, pos_y, pos_x+30, pos_y+30, al_map_rgb(255, 0, 255));
		//al_draw_line(pos_x+15, pos_y, pos_x+15, pos_y+50, square_color, 3);
		  //al_draw_bitmap(image, pos_x - image_width/2, pos_y - image_height/2, 0);
	  //al_draw_textf(font24, al_map_rgb(255, 255, 255), width/2, height-30, ALLEGRO_ALIGN_CENTRE,
		 // "frames: %i", frame_count);

  //al_draw_pixel(80, 200, al_map_rgb(255, 255, 0));
  //al_draw_line(100, 100, screenW-100, 100, al_map_rgb(0, 255, 0), 3);
  //al_draw_filled_triangle(100, 100, 100, 10, 180, 60, al_map_rgb(255, 0, 0));
  //al_draw_rounded_rectangle(100, 100, 200, 300, 5, 20, al_map_rgb(0, 128, 255), 8);
  //al_draw_circle(200, 200, 30, al_map_rgb(255, 255, 255), 4);
  //al_draw_ellipse(200, 200, 50, 20, al_map_rgb(0, 255, 255), 8);

  //al_draw_text(font24, al_map_rgb(0, 0, 128), 50, 50, 0, "hello world!");
  //al_draw_text(font36, al_map_rgb(0, 0, 128), 100, 100, 0, "hello world!");
  //al_draw_textf(font24, al_map_rgb(255, 255, 255), screenW/2, 400, ALLEGRO_ALIGN_CENTRE, 
	 // "text width variable output, screen width and height = %i, %i", screenW, screenH);

  //al_flip_display();
  //al_rest(5.0);

  //ALLEGRO_BITMAP* image = NULL;

  //ALLEGRO_FONT* font24 = al_load_font("arial.ttf", 24, 0);
  //ALLEGRO_FONT* font36 = al_load_font("arial.ttf", 36, 0);

  //image = al_create_bitmap(image_rad*2, image_rad*2);
  //image = al_load_bitmap("shit.jpg");
  //int image_width = al_get_bitmap_width(image);
  //int image_height = al_get_bitmap_height(image);
  //al_set_target_bitmap(image);
  //al_draw_filled_rectangle(image_rad-9, image_rad-9, image_rad+9, image_rad+9, al_map_rgb(255, 0, 0));
  //al_set_target_bitmap(al_get_backbuffer(display));
  
	// al_draw_filled_rectangle(pos_x, pos_y, pos_x+30, pos_y+30, square_color);
	//al_draw_line(pos_x+15, pos_y, pos_x+15, pos_y+50, square_color, 3);
		//al_flip_display();
		//al_clear_to_color(background_color);

  //al_destroy_bitmap(image);

//al_draw_filled_triangle(penis_x, penis_y, 
	//	penis_x+10, penis_y+penis_height-2*wheelradius, 
	//	penis_x-10, penis_y+penis_height-2*wheelradius, 
	//	al_map_rgb(255, 0, 255));

		//al_draw_rotated_bitmap(s->get_bitmap(), 0, 0, (s->get_pos_x1()-topleftx)/global_pixel_width, (s->get_pos_y1()-toplefty)/global_pixel_width, 45, 0);
		//al_draw_scaled_bitmap(s->get_bitmap(), 0, 0, width, height, x, y, width*scale, height*scale, 0);

		//// collision checker
  //      float fromX = min(s->get_pos_x1(), newX);
  //      float fromY = min(s->get_pos_y1(), newY);
  //      float toX = max(s->get_pos_x1(), newX);
  //      float toY = max(s->get_pos_y1(), newY);
  //      // get the tile locations
  //      int fromTileX = TileMapRenderer.pixelsToTiles(fromX);
  //      int fromTileY = TileMapRenderer.pixelsToTiles(fromY);
  //      int toTileX = TileMapRenderer.pixelsToTiles(
  //          toX + sprite.getWidth() - 1);
  //      int toTileY = TileMapRenderer.pixelsToTiles(
  //          toY + sprite.getHeight() - 1);
  //      // check each tile for a collision
  //      for (int x=fromTileX; x<=toTileX; x++) {
  //          for (int y=fromTileY; y<=toTileY; y++) {
  //              if (x < 0 || x >= map.getWidth() ||
  //                  map.getTile(x, y) != null)
  //              {
  //                  // collision found, return the tile
  //                  pointCache.setLocation(x, y);
  //                  return pointCache;
  //              }
  //          }
  //      }
  //      // no collision found
  //      return null;

			//b2EdgeShape shape;

			//shape.Set(v1, v2);
			//shape.m_hasVertex3 = true;
			//shape.m_vertex3 = v3;
			//chainbody->CreateFixture(&shape, 0.0f);

			//shape.Set(v2, v3);
			//shape.m_hasVertex0 = true;
			//shape.m_hasVertex3 = true;
			//shape.m_vertex0 = v1;
			//shape.m_vertex3 = v1;
			//chainbody->CreateFixture(&shape, 0.0f);

			//shape.Set(v3, v1);
			//shape.m_hasVertex0 = true;
			//shape.m_hasVertex3 = true;
			//shape.m_vertex0 = v2;
			//shape.m_vertex3 = v2;
			//chainbody->CreateFixture(&shape, 0.0f);
	
	//b2Vec2 vs[4];
	//vs[0].Set(1.7f, 8.0f);
	//vs[1].Set(1.0f, 8.25f);
	//vs[2].Set(0.0f, 8.0f);
	//vs[3].Set(-1.7f, 8.4f);
	//b2ChainShape chain;
	//chain.CreateLoop(vs, 4);
	//b2BodyDef chainBodyDef;
	//chainbody = box2d_world->CreateBody(&chainBodyDef);
	//b2PolygonShape chainBox;
	//chainBox.CreateFixture(&groundBox, 0.0f);
	//box2d_world->CreateBody(chain);

	//// ground body
	//b2BodyDef groundBodyDef;
	//groundBodyDef.position.Set(5.0f, 10.0f);
	//groundbody = box2d_world->CreateBody(&groundBodyDef);
	//b2PolygonShape groundBox;
	//groundBox.SetAsBox(50.0f, 0.0f);
	//groundbody->CreateFixture(&groundBox, 0.0f);

	//sprite_main = new sw_sprite_shizzle(1, -1);
	//sprites = new vector<sw_sprite*>();
	//springs = new vector<sw_spring*>();
	//sprites->push_back(sprite_main);
	//map = new sw_game_map();
	//map->load_map("maps/themap.txt");
	//for (int i=0; i<map->get_block_cols(); i++) {
	//	for (int j=0; j<map->get_block_rows(); j++) {
	//		if (map->get_block(i, j)==3) {
	//			sprites->push_back(new sw_sprite_enemy(i*map->get_block_width(), j*map->get_block_height()));
	//		} else if (map->get_block(i, j)==sw_game_map::WALL) {
	//			sprites->push_back(new sw_sprite_block(i*map->get_block_width(), j*map->get_block_height()));
	//		}
	//	}
	//}

	//for (unsigned int i=1; i<sprites->size(); i++) {
	//	for (unsigned int j=i+1; j<sprites->size(); j++) {
	//		springs->push_back(new sw_spring(sprites->at(i), sprites->at(j), 2, 20));
	//	}
	//}

	//al_draw_filled_rectangle(5, 10 + 300-life*290, 20, 300, al_map_rgb(0, 255, 0));

	//float topleftx = sprites->at(0)->get_pos_x1() - global_pixel_width*global_screen_width/2;
	//float toplefty = sprites->at(0)->get_pos_y2() - global_pixel_height*global_screen_height/2;
	////al_draw_bitmap(map->get_bitmap(), -topleftx/global_pixel_width, -toplefty/global_pixel_height, 0);
	//for(unsigned int y=0; y<sprites->size(); y++) {
	//	sw_sprite* s = sprites->at(y);
	//	int sx = 0; // top left pixel
	//	int sy = 0;
	//	int sw = al_get_bitmap_width(s->get_bitmap());
	//	int sh = al_get_bitmap_height(s->get_bitmap());
	//	int dx = (s->get_pos_x1()-topleftx) / global_pixel_width; // top left pixel
	//	int dy = (s->get_pos_y1()-toplefty) / global_pixel_width; // top left pixel
	//	int dw = s->get_width() / global_pixel_width;
	//	int dh = s->get_height() / global_pixel_height;
	//	al_draw_scaled_bitmap(s->get_bitmap(), sx, sy, sw, sh, dx, dy, dw, dh, 0);
	//	//al_draw_bitmap(s->get_bitmap(), dx, dy, 0);
	//}
	
	//for(unsigned int y=0; y<sprites->size(); y++) {
	//	sw_sprite* s = sprites->at(y);
	//	float mindist = -9999;
	//	for (unsigned int z=0; z<sprites->size(); z++) {
	//		sw_sprite* s2 = sprites->at(z);
	//		if (s2==s) continue; // can't analyse effects on yourself
	//		sw_spring* spr = new sw_spring(s, s2, 5, 5);
	//		//float dist = s->get_pos_y1() - s2->get_pos_y1();
	//		//if (dist > mindist) mindist = dist;
	//		//s->set_force_y(s->get_force_y() + 40.0 / dist / dist / dist);
	//		//s->set_force_y(s->get_mass()*9.8);
	//	}
	//for (unsigned int i=0; i<springs->size(); i++) {
	//	springs->at(i)->apply_forces();
	//}
	//for (unsigned int i=0; i<sprites->size(); i++) {
	//	sprites->at(i)->compute_time_step();
	//}

	//// destroy enemies
	//bool* destroy = new bool[sprites->size()];
	//sw_sprite* s = sprites->at(0);
	//vector<sw_sprite*>::iterator it;
	//for(it = sprites->begin()+1; it != sprites->end(); ) {
	//	sw_sprite* s2 = *it;
	//	if (s->get_pos_x1() < s2->get_pos_x2() && s->get_pos_x2() > s2->get_pos_x1() &&
	//		s->get_pos_y1() < s2->get_pos_y2() && s->get_pos_y2() > s2->get_pos_y1()) {
	//			it = sprites->erase(it);
	//			sound = true;
	//			sound_count = 0;
	//	} else {
	//		it++;
	//	}
	//}